<template>
  <header class="mint-header">
    <!-- 居左 -->
    <div class="mint-header-button is-left">
      
      <div class="router-link-active">
        <button class="mint-button mint-button-default mint-button-normal" @click="back">
          <span class="mint-button-icon">
            <i class="mintui mintui-back"></i>
          </span> 
          <label class="mint-button-text"></label>
        </button>
        <slot name="leftHeader"></slot>
      </div>
      
    </div>
    <!-- 居中文字 -->
    <h1 class="mint-header-title">{{ text }}</h1>
    <!-- 居右 -->
    <div class="mint-header-button is-right">
      <slot name="rightHeader"></slot>
    </div>
  </header>
</template>

<script>
import { Header } from 'mint-ui';
export default {
  name: 'carnt_Header',
  // 数据
  data () {
    return {

    }
  },
  props:{
    text: String,
    backPage: String
  },
  // 创建
  created () {

  },
  // 渲染
  mounted () {
    //alert(this.backPage)
    //alert(this.$store.state.ip)
  },
  // 销毁前
  beforeDestory () {

  },
  // 计算
  computed: {

  },
  // 方法
  methods: {
    back () {
      if(this.backPage == 'spray'){
        this.$router.push('/');
      }else if (this.backPage == 'index') {
        window.location.href = this.$store.state.ip + '/CARNT/jsp/pay/indexM.html';
      }else{
        this.$router.go(-1);
      }
      
    }
  },
  // 子组件
  components: {
    
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
.mint-header{
  color:#fff;
  height: .8rem;
  background: #e42e3b;
  font-size: .32rem;
  line-height: .8rem;
  width:7.5rem;
  padding: 0 .1rem;
  .router-link-active{
    display: block;
    height:.8rem;
    width: .8rem;
    font-size: .32rem;
    .mintui{
      font-size:.4rem!important;
    }
  }
}
</style>
